// pages/my/aboutus/index.js
const app = getApp()

Page({

  /**
   * 页面的初始数据
   */
  data: {
    content: "..."
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {

    if (options.id) {
      var param = {
        id: options.id
      };
      app.postRequestLoading("/rest/tenantdocument/view.htm", param, this.backDataView);
    }
    if (options.key) {
      var param = {
        key: options.key
      };
      app.postRequestLoading("/rest/tenantdocument/document.htm", param, this.backDataView);
    }



  },
  backDataView(res) {
    if (res.code == 0) {
      if (res.title) {
        wx.setNavigationBarTitle({
          title: '' + res.title,
          success: function (res) {},
          fail: function (res) {},
          complete: function (res) {},
        })
      }
      res.note = res.note.replace(/\s+style="[^"]*"/g, '');
      res.note = res.note.replace(/\<p/gi, '<P class="p" ');
      res.note = res.note.replace(/\<img/gi, '<img class="img" ');
      this.setData({
        content: res.note
      })
    }
  },
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})